package com.designPattern.p02sampleFactory.instance;

/**
 *  简单工厂模式 测试类
 * @author: luhd
 * @create: 2021-09-02
 */
public class SimpleFactoryTest {
    public static void main(String[] args) throws InstantiationException, IllegalAccessException {
        Food chicken = FoodFactory.getFood("chicken");
        Food chips = FoodFactory.getFood("chips");
        Food egg = FoodFactory.getFood("egg");
        if (chicken!=null){
            chicken.get();
        }
        if (chips!=null){
            chips.get();
        }
        if (egg!=null){
            egg.get();
        }
    }
}
